package com.zjj.edu.system.service.impl;

import com.zjj.edu.common.utils.DateUtils;
import com.zjj.edu.system.domain.SysTeachGoodsRecord;
import com.zjj.edu.system.mapper.SysTeachGoodsRecordMapper;
import com.zjj.edu.system.service.ISysTeachGoodsRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 教学物品异动Service业务层处理
 *
 * @author zjj
 * @date 2020-07-01
 */
@Service
public class SysTeachGoodsRecordServiceImpl implements ISysTeachGoodsRecordService
{
    @Autowired
    private SysTeachGoodsRecordMapper sysTeachGoodsRecordMapper;

    /**
     * 查询教学物品异动
     *
     * @param id 教学物品异动ID
     * @return 教学物品异动
     */
    @Override
    public SysTeachGoodsRecord selectSysTeachGoodsRecordById(Long id)
    {
        return sysTeachGoodsRecordMapper.selectSysTeachGoodsRecordById(id);
    }

    /**
     * 查询教学物品异动列表
     *
     * @param sysTeachGoodsRecord 教学物品异动
     * @return 教学物品异动
     */
    @Override
    public List<SysTeachGoodsRecord> selectSysTeachGoodsRecordList(SysTeachGoodsRecord sysTeachGoodsRecord)
    {
        return sysTeachGoodsRecordMapper.selectSysTeachGoodsRecordList(sysTeachGoodsRecord);
    }

    /**
     * 新增教学物品异动
     *
     * @param sysTeachGoodsRecord 教学物品异动
     * @return 结果
     */
    @Override
    public int insertSysTeachGoodsRecord(SysTeachGoodsRecord sysTeachGoodsRecord)
    {
        sysTeachGoodsRecord.setCreateTime(DateUtils.getNowDate());
        return sysTeachGoodsRecordMapper.insertSysTeachGoodsRecord(sysTeachGoodsRecord);
    }

}
